#ifndef __COMPONENT_LEVEL_H__
#define __COMPONENT_LEVEL_H__

#include "Component.hpp"
#include "Engine/Vector3.hpp"
#include "Engine/Quaternion.h"
#include "Game/IInventory.hpp"
#include "Game/CellFace.h"
#include "Game/TerrainRaycastResult.hpp"
#include "entt/entt.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{

    struct ComponentPlayer;

    struct ComponentLevel : public Component
    {
        float strengthFactor;
        float resilienceFactor;
        float speedFactor;
        float hungerFactor;

        ComponentPlayer *componentPlayer;

        float getStrengthFactor();
        float getResilienceFactor();
        float getSpeedFactor();
        float getHungerFactor();

        float calculateStrengthFactor();
        float calculateResilienceFactor();
        float calculateSpeedFactor();
        float calculateHungerFactor();

        void addExperience(int32_t count, bool playSound);
        void netAddExperience(int32_t count, bool playSound);

        static void AddClothingFactor(int32_t clothingValue, float &clothingFactor);

        virtual void update(float dt) override;
        virtual const std::string &getName() const override;
        static const std::string &GetName();
        virtual void load(const nlohmann::json &jsonData) override;
        virtual void save(nlohmann::json &jsonData) override;
        virtual void saveToMsgJson(nlohmann::json &jsonData) override;
    };

}

#endif